using UnityEngine;
using TMPro;

public class GridSystemDebugSingle : MonoBehaviour
{
    [SerializeField] private SpriteRenderer spriteRenderer;
    [SerializeField] private TextMeshProUGUI costText;
    [SerializeField] private TextMeshProUGUI bestCostText;
    private int x;
    private int y;
    private float gridNodeSize;
    public void Setup(int x, int y, float gridNodeSize)
    {
        this.x = x;
        this.y = y;
        this.gridNodeSize = gridNodeSize;
        transform.position = GridSystem.GetWorldPostion(x, y, gridNodeSize);
    }

    public void SetColor(Color color)
    {
        spriteRenderer.color = color;
    }

    public void SetSprite(Sprite sprite)
    {
        spriteRenderer.sprite = sprite;
    }

    public void SetSpriteRotation(Quaternion rotation)
    {
        spriteRenderer.transform.rotation = rotation;
        spriteRenderer.transform.rotation *= Quaternion.Euler(90, 0, 90);
    }
    public void SetCost(GridSystem.GridNode gridNode)
    {
        costText.text = ((int)gridNode.cost).ToString();
        bestCostText.text = ((int)gridNode.bestCost).ToString();
    }
}
